<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./js/vue2.js"></script>
</head>
<body>
    <div id="app">
        <h1>计时器：{{value}}</h1>
        <input type="button" value="开始计时" @click="a">
    </div>
</body>
<script>
        new Vue({
            el: '#app',
            data(){
                return {value:-1}
            },
            jishi(){
                setTimeout(this.a,1000)
            },
            methods:{
                a(){
                    this.value++
                    console.log(this.value)
                    setTimeout(this.a,1000)
                }
            }
        })
    </script>
</html>